@@ -62,7 +62,8 @@ public class PhotoRecyclerAdapter extends RecyclerView.Adapter<PhotoRecyclerAdap |
||
| 62 | 62 |
return; |
| 63 | 63 |
} |
| 64 | 64 |
final PhotoBean item = photoList.get(position); |
| 65 |
- String path = Constants.APP_IMAGE_DIR + File.separator+item.sessionId+File.separator+Constants.THUMBNAIL_DIR_NAME+File.separator+item.photoName; |
|
| 65 |
+ String path = Constants.APP_IMAGE_DIR + File.separator+item.sessionId+File.separator |
|
| 66 |
+ +Constants.THUMBNAIL_DIR_NAME+File.separator+item.photoName; |
|
| 66 | 67 |
ImageLoaderUtils.displayLocalImage(path, holder.photo, options); |
| 67 | 68 |
int height = width*10/16; |
| 68 | 69 |
ViewGroup.LayoutParams lp=holder.photo.getLayoutParams(); |
@@ -7,6 +7,7 @@ import android.support.v7.widget.LinearLayoutManager; |
||
| 7 | 7 |
import android.support.v7.widget.RecyclerView; |
| 8 | 8 |
import android.widget.ImageView; |
| 9 | 9 |
import android.widget.TextView; |
| 10 |
+import android.widget.Toast; |
|
| 10 | 11 |
|
| 11 | 12 |
import com.android.common.utils.LogHelper; |
| 12 | 13 |
|
@@ -30,6 +31,7 @@ public class UploadActivity extends BaseActivity implements UploadContract.View |
||
| 30 | 31 |
@BindView(R.id.recycler_view_sessions) RecyclerView sessionsRecyclerView; |
| 31 | 32 |
private SessionRecyclerAdapter adapter; |
| 32 | 33 |
private UploadContract.Presenter presenter; |
| 34 |
+ private long exitTime; |
|
| 33 | 35 |
|
| 34 | 36 |
@Override |
| 35 | 37 |
protected void onCreate(Bundle savedInstanceState) {
|
@@ -119,4 +121,14 @@ public class UploadActivity extends BaseActivity implements UploadContract.View |
||
| 119 | 121 |
startActivity(intent); |
| 120 | 122 |
} |
| 121 | 123 |
|
| 124 |
+ @Override |
|
| 125 |
+ public void onBackPressed() {
|
|
| 126 |
+ if(System.currentTimeMillis()-exitTime<3000){
|
|
| 127 |
+ super.onBackPressed(); |
|
| 128 |
+ }else{
|
|
| 129 |
+ Toast.makeText(this,R.string.app_exit_hint,Toast.LENGTH_SHORT).show(); |
|
| 130 |
+ } |
|
| 131 |
+ exitTime = System.currentTimeMillis(); |
|
| 132 |
+ } |
|
| 133 |
+ |
|
| 122 | 134 |
} |
@@ -32,7 +32,7 @@ public class ImageLoaderUtils {
|
||
| 32 | 32 |
|
| 33 | 33 |
public static DisplayImageOptions getOptions(int drawable) {
|
| 34 | 34 |
return new DisplayImageOptions.Builder() |
| 35 |
- .showImageForEmptyUri(drawable).showImageOnFail(drawable) |
|
| 35 |
+ .showImageForEmptyUri(drawable).showImageOnFail(drawable).showImageOnLoading(drawable) |
|
| 36 | 36 |
.cacheInMemory(true).cacheOnDisk(true).considerExifParams(true) |
| 37 | 37 |
.bitmapConfig(Bitmap.Config.RGB_565).imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2).build(); |
| 38 | 38 |
} |
@@ -38,4 +38,6 @@ |
||
| 38 | 38 |
<string name="check_version_fail">检查更新失败,请稍后重试</string> |
| 39 | 39 |
|
| 40 | 40 |
<string name="new_version_found">发现新版本,正在更新中</string> |
| 41 |
+ |
|
| 42 |
+ <string name="app_exit_hint">再按一次退出拍爱</string> |
|
| 41 | 43 |
</resources> |